package fun.xinnix.example;

import com.alibaba.fastjson2.JSONObject;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class TestMain {
    private Integer age;

    private String msg;
    public static void main(String[] args) {
        MessageSendRequest request = new MessageSendRequest();
        MessageSendModel model = new MessageSendModel();
        JSONObject data = JSONObject.of();
        data.put("keyword1", JSONObject.of("value", "message"));
        data.put("keyword2", JSONObject.of("value", "dateTime"));
        data.put("keyword3", JSONObject.of("value", "amount"));
        data.put("keyword4", JSONObject.of("value", "orderNo"));
        model.setData(data.toJSONString());
        request.setModel(model);

        RequestClient client = new DefaultClient();
        MessageSendResponse response = client.execute(request);
        if (response.isSuccess()) {
            log.info("success,{},{}", response.getCode(), response.getMessage());
        }
        log.info("response:{}", response);
    }
}
